package com.kaiwukj.android.ufamily.mvp.http.api.service;

import com.kaiwukj.android.ufamily.mvp.http.entity.base.BaseListResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.base.BaseObjResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.DoorAccessDeviceResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.DoorAccessRecordResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.HouseKeeperResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.MyAddressResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.MyHouseMemberResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.MyHouseResult;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface MineService {

    @GET("/admin/app/userAddress/page")
    Observable<BaseListResp<MyAddressResult>> fetchMyAddress(@Query("page") int page, @Query("pageSize") int pageSize);

    @PUT("/admin/app/userAddress/deleteById")
    Observable<BaseObjResp<Integer>> deleteMyAddressById(@Query("id") int id);

    @PUT("/admin/app/userAddress/updateUserAddress")
    Observable<BaseObjResp<Integer>> updateMyAddressById(@Body RequestBody body);

    @POST("/admin/app/userAddress/addUserAddress")
    Observable<BaseObjResp<Integer>> addMyAddress(@Body RequestBody body);

    @GET("/estate/app/room/myRoom")
    Observable<BaseObjResp<List<MyHouseResult>>> fetchMyHouse();

    @GET("/estate/app/room/getMemberList/{roomId}")
    Observable<BaseObjResp<List<MyHouseMemberResult>>> fetchHouseMember(@Path("roomId") Integer roomId);

    @POST("/estate/app/room/addMember")
    Observable<BaseObjResp<Integer>> addHouseMember(@Body RequestBody body);

    @GET("/estate/app/room/deleteMember/{ownerRoomId}")
    Observable<BaseObjResp<Integer>> delHouseMember(@Path("ownerRoomId") Integer ownerRoomId);

    @GET("/estate/app/estateDevice/deviceList")
    Observable<BaseObjResp<DoorAccessDeviceResult>> fetchDoorAccessDevice();

    @GET("/estate/app/estateDevice/getCapture")
    Observable<BaseListResp<DoorAccessRecordResult>> fetchDoorOpenHistory(@Query("monthDateStr") String month,
                                                                          @Query("page") Integer page,
                                                                          @Query("size") Integer size);

    @GET("/admin/app/housekeeper/getUserHouseKeeperHxName")
    Observable<BaseObjResp<HouseKeeperResult>> getMineHouseKeeper();

}
